
function [ x,y,hx,hy ,dimX,dimY,Xp,Yp] = createMeshB()
Nx1 = 6;
Nx2 = 20;
Nx3 = 8;


Lx1 = 3;
Lx2 = 8;
Lx3 = 12;

Ny1  = 6;
Ny2  = 12;
Ny3  = Ny1;

Ly1 = 0.7;
Ly2 = 1.3;
Ly3 = 2.0;




%% X spacing

dx1 = Lx1 / Nx1;

for i=1:(Nx1)
    hx(i)=dx1;    
end

dx2 = (Lx2-Lx1) / Nx2;

for i=(Nx1+1):(Nx1+Nx2)
    hx(i) = dx2;
end

dx3 = (Lx3-Lx2) / Nx3;

for i=(Nx1+Nx2+1):(Nx1+Nx2+Nx3)
    hx(i) = dx3;
end

dimHx = size (hx,2);
hx = [hx(1),hx,hx(dimHx)];
dimHx = size (hx,2);
x (1) = -0.5*hx(1);
for i=2:dimHx
    x(i) = x(i-1) + 0.5*(hx(i-1) +hx(i)); 
end

%% Y spacing


ya(1) = 0;
hya(1) = 1/Ny1;

for i=2:(Ny1)
    dy = i/Ny1;
    hya(i)= dy;
end

maxH = sum (hya);

hya = hya*Ly1/maxH;


dy2 = (Ly2-Ly1)/Ny2;

for i=1:(Ny2)
    hyb(i)= dy2;
end

for i=1:Ny3
    dy = (Ny3-i+1)/Ny3;
    hyc(i)= dy;
end
hyc = hyc*Ly1/maxH;

hy = [hya,hyb,hyc];

dimHy = size (hy,2);
hy = [hy(1),hy,hy(dimHy)]
dimHy = size (hy,2);

y (1) = -0.5*hy(1);
ya (1) = -0.5*hy(1);

for i=2:size(hya,2)
    ya(i) = ya(i-1) + 0.5*(hy(i-1) +hy(i)); 
end

for i=2:dimHy
    y(i) = y(i-1) + 0.5*(hy(i-1) +hy(i)); 
end
%pause







dimY = size (y,2);
dimX = size (x,2);

for i=1:dimX
    for j=1:dimY
        Xp (i,j) = x (i);
        Yp (i,j) = y (j);
    end
end


